<script>
    $(function () {
        //得到超链接传来的值
        function getQueryVariable(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var index = window.location.href.indexOf("?");
            var query = window.location.href.substr(1).substring(index);
            var r = query.match(reg);
            if ( r != null ){
                return decodeURI(r[2]);
            }else{
                return null;
            }
        }
        /*var test = getQueryVariable("userName");
        alert(test);*/


        layui.use(['form', 'table', 'miniPage', 'element'], function () {
            var $ = layui.jquery,
                form = layui.form,
                table = layui.table,
                miniPage = layui.miniPage;


            table.render({
                elem: '#currentTableId',
                height: 800,
                url: '/selectByUserName?userName='+getQueryVariable("employNameForm")+'',
                toolbar: '#toolbarDemo',
                defaultToolbar: ['filter', 'exports', 'print', {
                    title: '提示',
                    layEvent: 'LAYTABLE_TIPS',
                    icon: 'layui-icon-tips'
                }],
                cols: [[
                    {field: 'userNum', width: 130, title: '员工编号'},
                    {field: 'userName', width: 80, title: '姓名'},
                    {field: 'userDep', width: 120, title: '所属部门'},
                    {field: 'rsbApDate', width: 140, title: '日期', sort: true},
                    {field: 'rsbApType', width: 80, title: '类型', sort: true},
                    {field: 'rsbApOvertime', width: 120, title: '加班时长', sort: true},
                    {field: 'rsbApLong', width: 120, title: '请假天数', sort: true},
                    {field: 'rsbApReason', width: 300, title: '事由'},
                ]]
            });
        });
    })
</script>
<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">
        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
    </div>
</div>
<style>
    ::-webkit-scrollbar{
        height: 13px;
    }
</style>